/**
 * 
 */
package com.alstudio.pojo.module.user;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;

import android.text.TextUtils;

import com.alstudio.module.xmpp.protocol.xmpp.data.ALPhoto;

/**
 * @author alonso lee
 * 
 */
public class User implements Serializable {

	private static final long serialVersionUID = -7323314018400761124L;

	public static final int VIP_NONE = 0;
	public static final int VIP1 = 1;
	public static final int VIP2 = 2;
	public static final int VIP3 = 3;

	public static final int NO_AUTHETICATION = 0;
	public static final int ALREADY_AUTHETICATION = 1;
	public static final int AUTHETICATIONING = 2;
	
	public static final int EMAIL_UNBIND = 0;
	public static final int EMAIL_UNVERIFY = 1;
	public static final int EMAIL_BINDED = 2;

	// id
	private String id = "";
	// 用户id
	private String jid = "";
	// 用户昵称
	private String nick = "";
	// 备注名
	private String noteName = "";
	// 姓名拼音
	private String spellName = "";
	// 用户性别
	private String sex = "";
	// 用户等级
	private String grade = "";
	// 详细地理位置信息
	private String location = "";
	// 与我之间的距离
	private String distance = "";
	// 在线状态
	private boolean isOnline = false;
	// vip状态
	private boolean isVip = false;
	// 勋章。
	private ArrayList<String> medals = new ArrayList<String>();
	// 用户文件所在目录。用于保存此用户的图片或者其他信息
	private String dirPath = "";
	// 省份
	private String province = "";
	// 城市
	private String city = "";
	// 生日
	private String birthDay = "";
	// 电话号码
	private String phone = "";
	// email
	private String email = "";
	// 个性签名
	private String signature = "";
	// 人气信息
	private String popular = "";
	// 密码
	private String pwd = "";
	// 推荐人
	private String introductor = "";
	// 星座
	private String constellations = "";

	// 保存图片属性
	private ArrayList<ALPhoto> photoList = new ArrayList<ALPhoto>();
	// 勋章个数
	private int numOfMedals = 0;
	// 图片个数
	private int numOfPic = 0;
	// 我是否订阅了好友
	private String subscription = "";
	// 我订阅好友的时间
	private String endsubscriptionTime = "";
	// 此属性仅用于获取推荐列表时得到头像
	private String imageFileId = "";
	// 此变量仅用于我的名片。用于表示是否已经更新到服务器
	private boolean isSynchronized = false;

	// 与我的约会次数
	private String appointmentCount = "";
	// 收到的礼物个数
	private int giftCount = 0;
	// 收到的评价个数
	private int appraiseCount = 0;
	// 收到的评价id
	private String appraiseId = "";
	// 收藏时间
	private String favorites_time = "";
	// 特别关注
	private String special_focus = "";

	// 是否已经将此用户添加到我的收藏
	private boolean isFavorite = false;
	// 有多少收藏了该用户
	private String collectingnum = "";
	// 用户状态 0:离线 1:在线2:忙碌3:离开
	private int status = -1;
	// 是否对方已经在我的黑名单列表中
	private boolean inblacklist = false;
	// 语音介绍文件对象
	private Voiceintro voiceintro = new Voiceintro();
	// 婚恋状态
	private String marriystatus = "";
	// 身高
	private String height = "";
	// 体重
	private String weight = "";
	// 上一次在线时间
	private long lastLoginTimeStamp = 0;

	// 微博绑定状态
	private int weiBoIsBind = 0; // 0 未绑定 1 绑定

	// 微博昵称
	private String weibo_nick = "";

	// 微博uid
	private String weibo_uid = "";

	// 邮箱绑定状态
	private int emailIsBind = 0; // 0未绑定 1 绑定

	private String email_pwd = ""; // 邮箱密码

	private String email_addr = ""; // 绑定邮箱地址

	private String iconBackground = "";// 个人主页当前背景的fileID

	private String activityName;
	private String activityUrl;

	private int isKingOrQueen = -1; // 是否是国王、女王、钻石名人

	private int starState = 0;// 0不是名人,1为普通名人,2为钻石名人,3为国王,4为王后

	private int masterStarState = 0;// 0不是名人,1为普通名人,2为钻石名人,3为国王,4为王后

	private int famouslevel = -1;

	private CustTitles custtitles;

	public static final int NONE_MINGREN = 0;
	public static final int PUTONG_MINGREN = 1;
	public static final int CHAOJI_MINGREN = 2;
	public static final int ZHIZUN_MINGREN = 3;
	public static final int GUOWANG_MINGREN = 4;
	public static final int WANGHOU_MINGREN = 5;
	private String hatImage;

	public static final int UPDATE_BIRTHDAY = 0;
	public static final int UPDATE_MARRIAGE = 1;
	public static final int UPDATE_NICK = 2;
	public static final int UPDATE_JOB = 3;
	public static final int UPDATE_SIGNATURE = 4;
	public static final int UPDATE_INTEREST = 5;
	public static final int UPDATE_BACKGROUND = 6;
	public static final int UPDATE_REGION = 7;
	public static final int UPDATE_HEIGHT = 8;
	public static final int UPDATE_WEIGHT = 9;

	private boolean isChecked = false;

	/**
	 * 主页特效 TYPE_NULL：默认值 TYPE_SAKURA：樱花飞舞 TYPE_SNOW：雪花漫漫 TYPE_MAPLE：秋叶纷飞
	 * TYPE_ROSE：玫瑰之约 TYPE_FIREFLY：萤火虫 TYPE_BUBBLE：泡泡TYPE_BAT:万圣惊魂【蝙蝠】,
	 * TYPE_METEOR：流星雨夜, TYPE_STAR：星光熠熠,TYPE_BUTTERFLY：蝴蝶翩翩
	 */
	private AnimationType homeEffects = AnimationType.TYPE_NULL;

	// 可查看照片数
	private int viewMaxPhoto = 0;
	// 当前照片数
	private int photoCount = 0;

	// 粉丝数或者好友数
	private int fansFriendsCount;

	// 是否是我的粉丝
	private boolean isFans = false;

	// 呼叫价格
	private String callPrice;

	// 来电通知
	private boolean callNoticeState = false;
	// 屏蔽陌生人来电
	private boolean blockstrangercall = false;
	// 屏蔽陌生人留言
	private boolean blockstrangermsg = false;
	// 正在通话中
	private boolean isCalling = false;
	// 通话状态 　0已取消/1未接/2已接/3拒接/4自动拒接（来电提醒）
	private int callRecordType = CALL_STATE_NONE;
	// 呼叫、被呼叫
	private boolean isCaller = false;
	// 通话产生时间
	private long callTime;
	//什么都不是
	public static final int CALL_STATE_NONE = -1;
	// 已取消
	public static final int CALL_STATE_CANCEL = 0;
	// 未接
	public static final int CALL_STATE_MISS = 1;
	// 已接
	public static final int CALL_STATE_ACCEPT = 2;
	// 拒接
	public static final int CALL_STATE_REJECT = 3;
	// 自动拒接（来电提醒）
	public static final int CALL_STATE_CALL_NOTIFY = 4;

	/**
	 * 设置个人主页当前背景
	 * 
	 * @param iconBackground
	 */
	public void setIconBackground(String iconBackground) {
		this.iconBackground = iconBackground;
	}

	/**
	 * 得到个人主页当前背景
	 * 
	 * @return
	 */
	public String getIconBackground() {
		if (iconBackground == null)
			iconBackground = "";
		return iconBackground;
	}

	public String getEmail_addr() {
		return email_addr;
	}

	public void setEmail_addr(String email_addr) {
		this.email_addr = email_addr;
	}

	public String getEmail_pwd() {
		return email_pwd;
	}

	public void setEmail_pwd(String email_pwd) {
		this.email_pwd = email_pwd;
	}

	public int getEmailIsBind() {
		return emailIsBind;
	}

	public void setEmailIsBind(int emailIsBind) {
		this.emailIsBind = emailIsBind;
	}

	public String getWeibo_nick() {
		return weibo_nick;
	}

	public void setWeibo_nick(String weibo_nick) {
		this.weibo_nick = weibo_nick;
	}

	public String getWeibo_uid() {
		return weibo_uid;
	}

	public void setWeibo_uid(String weibo_uid) {
		this.weibo_uid = weibo_uid;
	}

	private int vAuthPos = -1;

	/**
	 * 2012-12-1 新协议新增字段
	 */
	// 访问量
	private String visits = "";
	// 经验值
	private Experience experience = new Experience();
	// 魅力值
	private String glamour = "";
	// 认证 (0未认证，1已认证，2认证中)
	private int vauthed = -1;
	// 称谓
	private ArrayList<String> titles = new ArrayList<String>();
	// 新称谓
	private HashMap<String, Boolean> titles2 = new HashMap<String, Boolean>();

	// 新称谓
	private HashMap<String, CustTitles> titles3 = new HashMap<String, CustTitles>();

	/**
	 * vip等级 没有：0 vip1:1 vip2:2 vip3:3
	 */
	private int viplevel = VIP_NONE;

	// 金币数
	private String myGold = "";
	// 我的积分
	private String myPoint = "";
	// 元宝
	private String myYuanbao = "";
	// 收到的自定义评价个数
	private int customAppraiseCount = 0;

	private String introduceUrl;
	private boolean isReady = false;
	// 个人主页活动特效的动画出现方式，0：缺省值，1：向上飘，2：向下飘
	private int homeActivityAppear = 0;
	// 个人主页活动特效的图片fileID
	private String homePic;

	private String undisturbedstatus = "0";// 免打扰状态
	private String isfriend;// 双方是否关注

	private String halloffame;// 是否名人堂 0/1
	// 勋章
	private ArrayList<Honor> honors = new ArrayList<Honor>();
	private int honorsCount = 0;

	// 徒弟
	private ArrayList<String> apprentices = null;
	private int apprenticesCount = 0;

	private int deleteType = -1;

	// 全球魅力总榜
	private int globalGlmour = 0;
	// 全球女神总榜
	private int globalGreet = 0;

	// 区域魅力总榜
	private int areaGlobalGlmour = 0;

	private String masterHonorItemId;
	private boolean isMasterShowOnPlaza = false;

	private String age;

	/**
	 * @param age
	 *            the age to set
	 */
	public void setAge(String age) {
		this.age = age;
	}

	/**
	 * @return the age
	 */
	public String getAge() {
		return age;
	}

	public int getAreaGlobalGlmour() {
		return areaGlobalGlmour;
	}

	public void setAreaGlobalGlmour(int areaGlobalGlmour) {
		this.areaGlobalGlmour = areaGlobalGlmour;
	}

	public int getAreaGlobalGreet() {
		return areaGlobalGreet;
	}

	public void setAreaGlobalGreet(int areaGlobalGreet) {
		this.areaGlobalGreet = areaGlobalGreet;
	}

	// 区域女神总榜
	private int areaGlobalGreet = 0;

	private int covergodness = 0;

	// 个人区域荣誉
	private ArrayList<AreaTitle> areaTitles = new ArrayList<AreaTitle>();

	public ArrayList<AreaTitle> getAreaTitles() {
		return areaTitles;
	}

	public void setAreaTitles(ArrayList<AreaTitle> areaTitles) {
		this.areaTitles = areaTitles;
	}

	/**
	 * 构造函数
	 * 
	 * @author Alonso lee
	 */
	public User() {
	}

	public void setvAuthPos(int vAuthPos) {
		this.vAuthPos = vAuthPos;
	}

	public int getvAuthPos() {
		return vAuthPos;
	}

	public int getGlobalGlmour() {
		return globalGlmour;
	}

	public void setGlobalGlmour(int globalGlmour) {
		this.globalGlmour = globalGlmour;
	}

	public int getGlobalGreet() {
		return globalGreet;
	}

	public void setGlobalGreet(int globalGreet) {
		this.globalGreet = globalGreet;
	}

	public String getSpellName() {
		return spellName;
	}

	public void setSpellName(String spellName) {
		this.spellName = spellName;
	}

	/**
	 * 构造函数
	 * 
	 * @param jid
	 *            jid
	 * @author Alonso lee
	 */
	public User(String jid) {
		if (jid != null) {
			this.jid = jid;
		}
	}

	/**
	 * 构造函数
	 * 
	 * @param jid
	 * @param nick
	 * @author Alonso lee
	 */
	public User(String jid, String nick) {
		if (jid != null) {
			this.jid = jid;
		}

		if (nick != null) {
			this.nick = nick;
		}
	}

	/**
	 * 设置用户jid
	 * 
	 * @param jid
	 * @author Alonso lee
	 */
	public void setJid(String jid) {
		if (jid != null) {
			if (jid.indexOf("/") != -1) {
				jid = jid.substring(0, jid.indexOf("/"));
			}
			this.jid = jid;
		}
	}

	/**
	 * 获取用户jid
	 * 
	 * @return 用户jid
	 * @author Alonso lee
	 */
	public String getJid() {
		return this.jid;
	}

	/**
	 * 获取用户jid中的id部分
	 * 
	 * @return 用户jid中的id部分
	 * @author
	 */
	public String getIdFromJid() {
		String idPart = this.jid;
		if (!TextUtils.isEmpty(idPart)) {
			int pos = idPart.indexOf("@");
			if (pos >= 0)
				idPart = idPart.substring(0, pos);
		}

		return idPart;
	}

	public void setNoteName(String name) {
		noteName = name;
	}

	public String getNoteName() {
		return noteName;
	}

	/**
	 * 设定昵称
	 * 
	 * @param nick
	 *            昵称
	 * @author Alonso lee
	 */
	public void setNick(String nick) {
		if (nick != null) {
			this.nick = nick;
			isSynchronized = false;
		}
	}

	/**
	 * 获取昵称
	 * 
	 * @return 该用户昵称
	 * @author Alonso lee
	 */
	public String getNick() {
		return this.nick;
	}

	/**
	 * 设定用户性别
	 * 
	 * @param sex
	 *            性别
	 * @author Alonso lee
	 */
	public void setSex(String sex) {
		if (sex != null) {
			this.sex = sex;
		}
	}

	/**
	 * 获取用户性别
	 * 
	 * @return 用户性别
	 * @author Alonso lee
	 */
	public String getSex() {
		return this.sex;
	}

	/**
	 * 设定等级
	 * 
	 * @param grade
	 *            等级
	 * @author Alonso lee
	 */
	public void setGrade(String grade) {
		if (grade != null) {
			this.grade = grade;
			isSynchronized = false;
		}
	}

	/**
	 * 获取用户等级
	 * 
	 * @return 用户顶级
	 * @author Alonso lee
	 */
	public String getGrade() {
		return this.grade;
	}

	/**
	 * 设定用户地理位置
	 * 
	 * @param location
	 *            用户地理位置
	 * @author Alonso lee
	 */
	public void setLocation(String location) {
		if (location != null) {
			this.location = location;
			isSynchronized = false;
		}
	}

	/**
	 * 获取用户地理位置
	 * 
	 * @return 用户地理位置
	 * @author Alonso lee
	 */
	public String getLocation() {
		return this.location;
	}

	/**
	 * 设定该用户与我之间的距离
	 * 
	 * @param distance
	 *            该用户与我之间的距离
	 * @author Alonso lee
	 */
	public void setDistance(String distance) {
		if (distance != null) {
			this.distance = distance;
		}
	}

	/**
	 * 获取该用户与我之间的距离
	 * 
	 * @return 该用户与我之间的距离
	 * @author Alonso lee
	 */
	public String getDistance() {
		return this.distance;
	}

	/**
	 * 设定在线状态
	 * 
	 * @param online
	 *            true为在线。false为离线
	 * @author Alonso lee
	 */
	public void setOnline(boolean online) {
		this.isOnline = online;
	}

	/**
	 * 获取用户是否在线
	 * 
	 * @return true，用户在线
	 * @author Alonso lee
	 */
	public boolean isOnline() {
		return this.isOnline;
	}

	/**
	 * 设定勋章列表
	 * 
	 * @param medals
	 *            勋章列表
	 * @author Alonso lee
	 */
	public void setMedals(ArrayList<String> medals) {
		this.medals = medals;
	}

	/**
	 * 获取勋章列表
	 * 
	 * @return 勋章列表
	 * @author Alonso lee
	 */
	public ArrayList<String> getMedals() {
		return this.medals;
	}

	/**
	 * 设定该用户目录地址
	 * 
	 * @param dirPath
	 *            目录地址
	 * @author Alonso lee
	 */
	public void setDirPath(String dirPath) {
		this.dirPath = dirPath;
	}

	/**
	 * 获取该用户目录地址
	 * 
	 * @return 该用户目录地址
	 * @author Alonso lee
	 */
	public String getDirpString() {
		return this.dirPath;
	}

	/**
	 * 设定省份
	 * 
	 * @param province
	 *            省份
	 * @author Alonso lee
	 */
	public void setProvince(String province) {
		if (province != null) {
			this.province = province;
			isSynchronized = false;
		}
	}

	/**
	 * 获取省份
	 * 
	 * @return 省份
	 * @author Alonso lee
	 */
	public String getProvince() {
		return this.province;
	}

	/**
	 * 设定城市
	 * 
	 * @param city
	 *            城市
	 * @author Alonso lee
	 */
	public void setCity(String city) {
		if (city != null) {
			this.city = city;
			isSynchronized = false;
		}
	}

	/**
	 * 获取城市
	 * 
	 * @return 城市
	 * @author Alonso lee
	 */
	public String getCity() {
		return this.city;
	}

	/**
	 * 设定生日
	 * 
	 * @param birthDay
	 *            生日
	 * @author Alonso lee
	 */
	public void setBirthday(String birthDay) {
		if (birthDay != null) {
			this.birthDay = birthDay;
			isSynchronized = false;
		}
	}

	/**
	 * 获取生日
	 * 
	 * @return 生日
	 * @author Alonso lee
	 */
	public String getBirtyday() {
		return this.birthDay;
	}

	/**
	 * 设定星座信息
	 * 
	 * @param constellations
	 *            星座信息
	 * @author Alonso lee
	 */
	public void setConstellations(String constellations) {
		if (constellations != null) {
			this.constellations = constellations;
			isSynchronized = false;
		}
	}

	/**
	 * 获取星座信息
	 * 
	 * @return
	 * @author Alonso lee
	 */
	public String getConstellations() {
		return this.constellations;
	}

	/**
	 * 设定电话
	 * 
	 * @param phone
	 *            电话
	 * @author Alonso lee
	 */
	public void setPhone(String phone) {
		if (phone != null) {
			this.phone = phone;
			isSynchronized = false;
		}
	}

	/**
	 * 获取电话
	 * 
	 * @return 电话
	 * @author Alonso lee
	 */
	public String getPhone() {
		return this.phone;
	}

	/**
	 * 设定email
	 * 
	 * @param email
	 * @author Alonso lee
	 */
	public void setEmail(String email) {
		if (email != null) {
			this.email = email;
			isSynchronized = false;
		}
	}

	/**
	 * 获取email
	 * 
	 * @return email
	 * @author Alonso lee
	 */
	public String getEmail() {
		return this.email;
	}

	/**
	 * 设定是否是VIP
	 * 
	 * @param vip
	 *            true vip
	 * @author Alonso lee
	 */
	public void setIsVip(boolean vip) {
		this.isVip = vip;
	}

	/**
	 * 获取是否是VIP
	 * 
	 * @return true vip
	 * @author Alonso lee
	 */
	public boolean isVip() {
		return this.isVip;
	}

	/**
	 * 设置个性签名
	 * 
	 * @param signature
	 *            个性签名
	 * @author Alonso lee
	 */
	public void setSignature(String signature) {
		if (signature != null) {
			this.signature = signature;
			isSynchronized = false;
		}
	}

	/**
	 * 获取个性签名
	 * 
	 * @return 个性签名
	 * @author Alonso lee
	 */
	public String getSignature() {
		return this.signature;
	}

	/**
	 * 设定图片列表
	 * 
	 * @param photoList
	 *            图片列表
	 * @author Alonso lee
	 */
	public void setPhotos(ArrayList<ALPhoto> p) {
		// this.photoList = photoList;
		// this.photoList.clear();
		// this.photoList.addAll(p);
		// ALLog.d("传入图片" + p.size());
		// this.photoList = p;
		// isSynchronized = false;

		this.photoList.clear();
		this.photoList.addAll(p);
		isSynchronized = false;
	}

	/**
	 * 获取图片列表
	 * 
	 * @return 图片列表
	 * @author Alonso lee
	 */
	public ArrayList<ALPhoto> getPhotos() {
		return this.photoList;
	}

	/**
	 * 设定勋章个数
	 * 
	 * @param num
	 *            勋章个数
	 * @author Alonso lee
	 */
	public void setNumOfMedals(int num) {
		this.numOfMedals = num;
	}

	/**
	 * 获取勋章个数
	 * 
	 * @return 勋章个数
	 * @author Alonso lee
	 */
	public int getNumofMedals() {
		return this.numOfMedals;
	}

	/**
	 * 设定头像个数
	 * 
	 * @param num
	 *            头像个数
	 * @author Alonso lee
	 */
	public void setNumofPic(int num) {
		this.numOfPic = num;
	}

	/**
	 * 获取头像个数
	 * 
	 * @return 头像个数
	 * @author Alonso lee
	 */
	public int getNumofPic() {
		return this.numOfPic;
	}

	/**
	 * 设定好友与我的订阅关系
	 * 
	 * @param subscription
	 *            好友与我的订阅关系
	 * @author Alonso lee
	 */
	public void setSubscription(String subscription) {
		if (subscription != null) {
			this.subscription = subscription;
		}
	}

	/**
	 * 获取好友与我的订阅关系
	 * 
	 * @return 好友与我的订阅关系。当前只有有效值为"to"。表示本机订阅了该用户。
	 * @author Alonso lee
	 */
	public String getSubscription() {
		return this.subscription;
	}

	public boolean isSubscripted() {
		if (!TextUtils.isEmpty(subscription)) {
			if ("to".equals(subscription)) {
				return true;
			}
		}
		return false;
	}

	/**
	 * 设定推荐用户的头像id
	 * 
	 * @param imageFileId
	 *            推荐用户的头像id
	 * @author Alonso lee
	 */
	public void setImageFileId(String imageFileId) {
		if (imageFileId != null) {
			this.imageFileId = imageFileId;
		}
	}

	/**
	 * 获取推荐用户的头像id
	 * 
	 * @return 推荐用户的头像id
	 * @author Alonso lee
	 */
	public String getImageFileId() {
		if (!TextUtils.isEmpty(imageFileId))
			return this.imageFileId;
		return getThumbAvatar();
	}

	/**
	 * 设定我的人气信息
	 * 
	 * @param p
	 * @author Alonso lee
	 */
	public void setPopularity(String p) {
		if (p != null) {
			this.popular = p;
		}
	}

	/**
	 * 获取我的人气信息
	 * 
	 * @return
	 * @author Alonso lee
	 */
	public String getPopularity() {
		return this.popular;
	}

	/**
	 * 设定密码
	 * 
	 * @param pwd
	 * @author Alonso lee
	 */
	public void setPwd(String pwd) {
		if (pwd != null) {
			this.pwd = pwd;
		}
	}

	/**
	 * 获取密码
	 * 
	 * @param pwd
	 * @return
	 * @author Alonso lee
	 */
	public String getPwd() {
		return this.pwd;
	}

	/**
	 * 设定推荐人
	 * 
	 * @param in
	 * @author Alonso lee
	 */
	public void setIntroductor(String in) {
		if (in != null) {
			this.introductor = in;
		}
	}

	/**
	 * 获取推荐人
	 * 
	 * @return
	 * @author Alonso lee
	 */
	public String getIntroductor() {
		return this.introductor;
	}

	/**
	 * 设定赐名片是否已经更新到服务器
	 * 
	 * @return
	 * @author Alonso lee
	 */
	public void setSynchronized(boolean isSynchronized) {
		this.isSynchronized = isSynchronized;
	}

	/**
	 * 查询设定赐名片是否已经更新到服务器
	 * 
	 * @return true 已更新
	 * @author Alonso lee
	 */
	public boolean isSynchronized() {
		return this.isSynchronized;
	}

	/**
	 * 设定与我的约会次数
	 * 
	 * @param count
	 *            与我的约会次数
	 */
	public void setAppointmentCount(String count) {
		if (count != null) {
			this.appointmentCount = count;
		}
	}

	/**
	 * 获取与我的约会次数
	 * 
	 * @return 与我的约会次数
	 */
	public String getAppointmentCount() {
		return this.appointmentCount;
	}

	/**
	 * 设定收到的礼物个数
	 * 
	 * @param count
	 *            收到的礼物个数
	 */
	public void setGiftCount(String count) {
		if (count != null) {
			this.giftCount = Integer.parseInt(count);
		}
	}

	/**
	 * 获取收到的礼物个数
	 * 
	 * @return 收到的礼物个数
	 */
	public int getGiftCount() {
		return this.giftCount;
	}

	/**
	 * 设定收到的评价个数
	 * 
	 * @param appraiseCount
	 *            收到的评价个数
	 */
	public void setAppraiseCount(String appraiseCount) {
		if (appraiseCount != null) {
			this.appraiseCount = Integer.parseInt(appraiseCount);
		}
	}

	/**
	 * 获取收到的评价个数
	 * 
	 * @return 收到的评价个数
	 */
	public int getAppraiseCount() {
		return this.appraiseCount;
	}

	/**
	 * 设定收到的评价id
	 * 
	 * @param id
	 */
	public void setAppraiseId(String id) {
		if (id != null) {
			this.appraiseId = id;
		}
	}

	/**
	 * 获取收到的评价id
	 * 
	 * @return
	 */
	public String getAppraiseId() {
		return this.appraiseId;
	}

	/**
	 * 检测此用户已经在我的收藏列表
	 * 
	 * @return true表示此用户已经在我的收藏列表
	 */
	public boolean isFavorite() {
		return this.isFavorite;
	}

	/**
	 * 获取被收藏次数
	 * 
	 * @return the collectingnum
	 */
	public String getCollectingnum() {
		return collectingnum;
	}

	/**
	 * 设置被收藏次数
	 * 
	 * @param collectingnum
	 *            the collectingnum to set
	 */
	public void setCollectingnum(String collectingnum) {
		this.collectingnum = collectingnum;
	}

	/**
	 * 获取用户状态
	 * 
	 * @return the status
	 */
	public int getStatus() {
		return status;
	}

	/**
	 * 设置用户状态
	 * 
	 * @param status
	 *            the status to set
	 */
	public void setStatus(int status) {
		this.status = status;
	}

	/**
	 * 获取语音介绍对象
	 * 
	 * @return the voiceintro
	 */
	public Voiceintro getVoiceintro() {
		return voiceintro;
	}

	/**
	 * 设置语音介绍对象
	 * 
	 * @param voiceintro
	 *            the voiceintro to set
	 */
	public void setVoiceintro(Voiceintro voiceintro) {
		this.voiceintro = voiceintro;
		isSynchronized = false;
	}

	/**
	 * 获取收藏时间
	 * 
	 * @return the favorites_time
	 */
	public String getFavorites_time() {
		return favorites_time;
	}

	/**
	 * 设置收藏时间
	 * 
	 * @param favorites_time
	 *            the favorites_time to set
	 */
	public void setFavorites_time(String favorites_time) {
		this.favorites_time = favorites_time;
	}

	/**
	 * 获取用户Id
	 * 
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * 设置用户Id
	 * 
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 获取用户是否在我的黑名单
	 * 
	 * @return
	 */
	public boolean isInblacklist() {
		return inblacklist;
	}

	/**
	 * 设置用户是否在我的黑名单
	 */
	public void setInblacklist(boolean inblacklist) {
		this.inblacklist = inblacklist;
	}

	public String getThumbAvatar() {
		if (this.photoList.size() > 0)
			return this.photoList.get(0).getThumbnailFileid();
		else
			return "";
	}

	public String getAvatar() {
		if (this.photoList.size() > 0)
			return this.photoList.get(0).getPicFileid();
		else
			return "";
	}

	/**
	 * 设定婚恋状态
	 * 
	 * @param marriystatus
	 */
	public void setMarriystatus(String marriystatus) {
		if (marriystatus != null) {
			this.marriystatus = marriystatus;
		}
	}

	/**
	 * 获取婚恋状态
	 * 
	 * @return
	 */
	public String getMarriystatus() {
		return this.marriystatus;
	}

	/**
	 * 设置身高
	 * 
	 * @param height
	 */
	public void setHeight(String height) {
		if (height != null) {
			this.height = height;
		}
	}

	/**
	 * 获取身高
	 * 
	 * @return
	 */
	public String getHeight() {
		return this.height;
	}

	/**
	 * 设置体重
	 * 
	 * @param weight
	 */
	public void setWeight(String weight) {
		if (weight != null) {
			this.weight = weight;
		}
	}

	/**
	 * 获取体重
	 * 
	 * @return
	 */
	public String getWeight() {
		return this.weight;
	}

	/**
	 * 设定上一次登录时间戳
	 * 
	 * @param lastLoginTimeStamp
	 */
	public void setLastLoginTimeStamp(long lastLoginTimeStamp) {
		this.lastLoginTimeStamp = lastLoginTimeStamp;
	}

	/**
	 * 获取上一次登录时间戳,注意,数值为妙
	 * 
	 * @return
	 */
	public long getLastLoginTimeStamp() {
		return this.lastLoginTimeStamp;
	}

	/**
	 * 设定访问量
	 * 
	 * @param visits
	 */
	public void setVisits(String visits) {
		this.visits = visits;
	}

	/**
	 * 获取访问量
	 * 
	 * @return
	 */
	public String getVisits() {
		return this.visits;
	}

	/**
	 * 设定经验值
	 * 
	 * @param experience
	 */
	public void setExperience(Experience experience) {
		this.experience = experience;
	}

	/**
	 * 获取经验值
	 * 
	 * @return
	 */
	public Experience getExperience() {
		return this.experience;
	}

	/**
	 * 设定魅力值
	 * 
	 * @param glamour
	 */
	public void setGlamour(String glamour) {
		this.glamour = glamour;
	}

	/**
	 * 获取魅力值
	 * 
	 * @return
	 */
	public String getGlamour() {
		return this.glamour;
	}

	/**
	 * 设定认证
	 * 
	 * @param vauthed
	 */
	public void setVauthed(int vauthed) {
		this.vauthed = vauthed;
	}

	/**
	 * 获取认证
	 * 
	 * @return
	 */
	public int getVauthed() {
		return this.vauthed;
	}

	/**
	 * 检测是否已经是认证用户
	 * 
	 * @return
	 */
	public boolean isVauthed() {
		return vauthed == 1 ? true : false;
	}

	/**
	 * 设定称谓
	 * 
	 * @param vauthed
	 */
	public void setTitles(ArrayList<String> titles) {
		this.titles = titles;
	}

	/**
	 * 获取称谓
	 * 
	 * @return
	 */
	public ArrayList<String> getTitles() {
		return this.titles;
	}

	/**
	 * 设定vip等级
	 * 
	 * @param viplevel
	 */
	public void setViplevel(int viplevel) {
		this.viplevel = viplevel;
	}

	/**
	 * 获取vip等级
	 * 
	 * @return
	 */
	public int getViplevel() {
		return this.viplevel;
	}

	/**
	 * 是否为男性
	 * 
	 * @return
	 */
	public boolean isMale() {
		if (TextUtils.isEmpty(this.sex))
			return false;

		return this.sex.equals("male");
	}

	/**
	 * 是否为女性
	 * 
	 * @return
	 */
	public boolean isFemale() {
		if (TextUtils.isEmpty(this.sex))
			return false;

		return this.sex.equals("female");
	}

	/**
	 * 设定我的金币数
	 * 
	 * @param myGold
	 */
	public void setGold(String gold) {
		this.myGold = gold;
	}

	/**
	 * 获取我的金币数
	 * 
	 * @return
	 */
	public String getGold() {
		return this.myGold;
	}

	/**
	 * 设定我的积分数
	 * 
	 * @param myGold
	 */
	public void setPoints(String p) {
		this.myPoint = p;
	}

	/**
	 * 获取我的积分数
	 * 
	 * @return
	 */
	public String getPoint() {
		return this.myPoint;
	}

	/**
	 * 设定收到的自定义评价个数
	 * 
	 * @param customAppraiseCount
	 *            收到的自定义评价个数
	 */
	public void setCustomAppraiseCount(String count) {
		if (count != null) {
			this.customAppraiseCount = Integer.parseInt(count);
		}
	}

	/**
	 * 获取收到的自定义评价个数
	 * 
	 * @return 收到的自定义评价个数
	 */
	public int getCustomAppraiseCount() {
		return this.customAppraiseCount;
	}

	public void setIntroduceUrl(String url) {
		introduceUrl = url;
	}

	public String getIntroduceUrl() {
		return introduceUrl;
	}

	public void setReadyState(boolean r) {
		this.isReady = r;
	}

	public boolean isReady() {
		return this.isReady;
	}

	public void setHomeEffects(AnimationType homeEffects) {
		this.homeEffects = homeEffects;
	}

	public AnimationType getHomeEffects() {
		return homeEffects;
	}

	public HashMap<String, Boolean> getTitles2() {
		return titles2;
	}

	public void setTitles2(HashMap<String, Boolean> titles2) {
		this.titles2 = titles2;
	}

	public String getUndisturbedstatus() {
		return undisturbedstatus;
	}

	public void setUndisturbedstatus(String undisturbedstatus) {
		this.undisturbedstatus = undisturbedstatus;
	}

	public boolean getIsfriend() {
		if (TextUtils.isEmpty(isfriend))
			return false;
		return "1".equals(isfriend) ? true : false;
	}

	public void setIsfriend(String isfriend) {
		this.isfriend = isfriend;
	}

	public int getDeleteType() {
		return deleteType;
	}

	public void setDeleteType(int deleteType) {
		this.deleteType = deleteType;
	}

	public String getHalloffame() {
		return halloffame;
	}

	public void setHalloffame(String halloffame) {
		this.halloffame = halloffame;
	}

	public ArrayList<Honor> getHonors() {
		return honors;
	}

	public void setHonors(ArrayList<Honor> honors) {
		this.honors = honors;
	}

	public ArrayList<String> getApprentices() {
		return apprentices;
	}

	public void setApprentices(ArrayList<String> apprentices) {
		this.apprentices = apprentices;
	}

	public int getHonorsCount() {
		return honorsCount;
	}

	public void setHonorsCount(int honorsCount) {
		this.honorsCount = honorsCount;
	}

	public int getApprenticesCount() {
		return apprenticesCount;
	}

	public void setApprenticesCount(int apprenticesCount) {
		this.apprenticesCount = apprenticesCount;
	}

	public void setYuanbao(String myYuanbao) {
		this.myYuanbao = myYuanbao;
	}

	public String getYuanbao() {
		return myYuanbao;
	}

	public void setCovergodness(int covergodness) {
		this.covergodness = covergodness;
	}

	public int getCovergodness() {
		return covergodness;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((jid == null) ? 0 : jid.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (jid == null) {
			if (other.jid != null)
				return false;
		} else if (!jid.equals(other.jid))
			return false;
		return true;
	}

	/**
	 * 查看微博的绑定状态
	 * 
	 * @return
	 */
	public int getWeiBoIsBind() {
		return weiBoIsBind;
	}

	/**
	 * 设置微博的绑定状态
	 * 
	 * @param weiBoIsBind
	 */
	public void setWeiBoIsBind(int weiBoIsBind) {
		this.weiBoIsBind = weiBoIsBind;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", jid=" + jid + ", nick=" + nick
				+ ", spellName=" + spellName + ", subscription=" + subscription
				+ ", isSynchronized=" + isSynchronized + ", special_focus="
				+ special_focus + ", isFavorite=" + isFavorite + ", isfriend="
				+ isfriend + "]";
	}

	public String getSpecial_focus() {
		return special_focus;
	}

	public void setSpecial_focus(String special_focus) {
		this.special_focus = special_focus;
	}

	public String getEndsubscriptionTime() {
		return endsubscriptionTime;
	}

	public void setEndsubscriptionTime(String endsubscriptionTime) {
		this.endsubscriptionTime = endsubscriptionTime;
	}

	public String getAtNick() {
		if (TextUtils.isEmpty(nick)) {
			return "";
		}
		return " @" + nick + " ";
	}

	public void setActivityName(String activityName) {
		this.activityName = activityName;
	}

	public String getActivityName() {
		return activityName;
	}

	public void setActivityUrl(String activityUrl) {
		this.activityUrl = activityUrl;
	}

	public String getActivityUrl() {
		return activityUrl;
	}

	/**
	 * 是否为名人
	 * 
	 * @return
	 */
	public boolean isHallOfFame() {
		if (!TextUtils.isEmpty(halloffame)) {
			if (halloffame.equals("1")) {
				return true;
			}
		}
		return false;
	}

	public void setMasterHonorItemId(String masterHonorItemId) {
		this.masterHonorItemId = masterHonorItemId;
	}

	public String getMasterHonorItemId() {
		return masterHonorItemId;
	}

	public void setMasterShowOnPlaza(boolean isMasterShowOnPlaza) {
		this.isMasterShowOnPlaza = isMasterShowOnPlaza;
	}

	public boolean isMasterShowOnPlaza() {
		return isMasterShowOnPlaza;
	}

	public void setCusttitles(CustTitles custtitles) {
		this.custtitles = custtitles;
	}

	public CustTitles getCusttitles() {
		return custtitles;
	}

	public void setTitles3(HashMap<String, CustTitles> titles3) {
		this.titles3 = titles3;
	}

	public HashMap<String, CustTitles> getTitles3() {
		return titles3;
	}

	public void setIsKingOrQueen(int isKingOrQueen) {
		this.isKingOrQueen = isKingOrQueen;
	}

	public int getIsKingOrQueen() {
		return isKingOrQueen;
	}

	/**
	 * 设置名人动态称谓
	 * 
	 * @param starState
	 */
	public void setStarState(int starState) {
		this.starState = starState;
	}

	/**
	 * 得到名人动态称谓
	 * 
	 * @return
	 */
	public int getStarState() {
		return starState;
	}

	public void setHomeActivityAppear(int homeActivityAppear) {
		this.homeActivityAppear = homeActivityAppear;
	}

	public int getHomeActivityAppear() {
		return homeActivityAppear;
	}

	public void setHomePic(String homePic) {
		this.homePic = homePic;
	}

	public String getHomePic() {
		return homePic;
	}

	public int getFamouslevel() {
		return famouslevel;
	}

	public void setFamouslevel(int famouslevel) {
		this.famouslevel = famouslevel;
	}

	public void setMasterStarState(int masterStarState) {
		this.masterStarState = masterStarState;
	}

	public int getMasterStarState() {
		return masterStarState;
	}

	public String getHatImage() {
		return hatImage;
	}

	public void setHatImage(String hatImage) {
		this.hatImage = hatImage;
	}

	/**
	 * 获取兴趣爱好的选中状态 true of false
	 * 
	 * @return the isChecked
	 */
	public boolean isChecked() {
		return isChecked;
	}

	/**
	 * 设置兴趣爱好的选中状态
	 * 
	 * @param isChecked
	 *            the isChecked to set
	 */
	public void setChecked(boolean isChecked) {
		this.isChecked = isChecked;
	}

	/**
	 * @return the viewMaxPhoto
	 */
	public int getViewMaxPhoto() {
		return viewMaxPhoto;
	}

	/**
	 * @param viewMaxPhoto
	 *            the viewMaxPhoto to set
	 */
	public void setViewMaxPhoto(int viewMaxPhoto) {
		this.viewMaxPhoto = viewMaxPhoto;
	}

	/**
	 * @return the photoCount
	 */
	public int getPhotoCount() {
		return photoCount;
	}

	/**
	 * @param photoCount
	 *            the photoCount to set
	 */
	public void setPhotoCount(int photoCount) {
		this.photoCount = photoCount;
	}

	/**
	 * @param fansFriendsCount
	 *            the fansFriendsCount to set
	 */
	public void setFansFriendsCount(int fansFriendsCount) {
		this.fansFriendsCount = fansFriendsCount;
	}

	/**
	 * @return the fansFriendsCount
	 */
	public int getFansFriendsCount() {
		return fansFriendsCount;
	}

	/**
	 * @return the isFans
	 */
	public boolean isFans() {
		return isFans;
	}

	/**
	 * @param isFans
	 *            the isFans to set
	 */
	public void setFans(boolean isFans) {
		this.isFans = isFans;
	}

	/**
	 * @param isFavorite
	 *            the isFavorite to set
	 */
	public void setFavorite(boolean isFavorite) {
		this.isFavorite = isFavorite;
	}

	/**
	 * @param callPrice
	 *            the callPrice to set
	 */
	public void setCallPrice(String callPrice) {
		this.callPrice = callPrice;
	}

	/**
	 * @return the callPrice
	 */
	public String getCallPrice() {
		return callPrice;
	}

	public String getBareJid() {
		if (TextUtils.isEmpty(jid))
			return "";
		if (!jid.contains("@"))
			return jid;
		String jid2 = "";
		if (jid != null && jid.length() > 0) {
			int index = jid.indexOf("@");
			jid2 = jid.substring(0, index);
		}

		return jid2;
	}

	/**
	 * @param callNoticeState
	 *            the callNoticeState to set
	 */
	public void setCallNoticeState(boolean callNoticeState) {
		this.callNoticeState = callNoticeState;
	}

	/**
	 * @return the callNoticeState
	 */
	public boolean getCallNoticeState() {
		return callNoticeState;
	}

	/**
	 * @return the blockstrangercall
	 */
	public boolean isBlockstrangercall() {
		return blockstrangercall;
	}

	/**
	 * @param blockstrangercall
	 *            the blockstrangercall to set
	 */
	public void setBlockstrangercall(boolean blockstrangercall) {
		this.blockstrangercall = blockstrangercall;
	}

	/**
	 * @return the blockstrangermsg
	 */
	public boolean isBlockstrangermsg() {
		return blockstrangermsg;
	}

	/**
	 * @param blockstrangermsg
	 *            the blockstrangermsg to set
	 */
	public void setBlockstrangermsg(boolean blockstrangermsg) {
		this.blockstrangermsg = blockstrangermsg;
	}

	public void setCalling(boolean isCalling) {
		this.isCalling = isCalling;
	}

	public boolean isCalling() {
		return isCalling;
	}
	
	/**
	 * @param isCaller the isCaller to set
	 */
	public void setIsCaller(boolean isCaller) {
		this.isCaller = isCaller;
	}
	
	/**
	 * @return the isCaller
	 */
	public boolean isCaller() {
		return isCaller;
	}
	
	/**
	 * @param callRecordType the callRecordType to set
	 */
	public void setCallRecordType(int callRecordType) {
		this.callRecordType = callRecordType;
	}
	
	/**
	 * @return the callRecordType
	 */
	public int getCallRecordType() {
		return callRecordType;
	}
	
	/**
	 * @param callTime the callTime to set
	 */
	public void setCallTime(long callTime) {
		this.callTime = callTime;
	}
	
	/**
	 * @return the callTime
	 */
	public long getCallTime() {
		return callTime;
	}

}
